home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / dflat8.zip / DIALBOX.H < prev    next >
Text File  |  1991-09-04  |  2KB  |  55 lines

  1. /* ----------------- dialbox.h ---------------- */
  2.  
  3. #ifndef DIALOG_H
  4. #define DIALOG_H
  5.  
  6. #include <stdio.h>
  7.  
  8. #define MAXCONTROLS 26
  9. #define MAXRADIOS 20
  10.  
  11. #define OFF FALSE
  12. #define ON  TRUE
  13.  
  14. /* -------- dialog box and control window structure ------- */
  15. typedef struct  {
  16.     char *title;    /* window title         */
  17.     int x, y;       /* relative coordinates */
  18.     int h, w;       /* size                 */
  19. } DIALOGWINDOW;
  20.  
  21. /* ------ one of these for each control window ------- */
  22. typedef struct {
  23.     DIALOGWINDOW dwnd;
  24.     CLASS class;    /* LISTBOX, BUTTON, etc */
  25.     char *itext;    /* initialized text     */
  26.     char *vtext;    /* variable text        */
  27.     int command;    /* command code         */
  28.     char *help;     /* help mnemonic        */
  29.     int isetting;   /* initially ON or OFF  */
  30.     int setting;    /* ON or OFF            */
  31.     void *wnd;      /* window handle        */
  32. } CTLWINDOW;
  33.  
  34. /* --------- one of these for each dialog box ------- */
  35. typedef struct {
  36.     char *HelpName;
  37.     DIALOGWINDOW dwnd;
  38.     CTLWINDOW ctl[MAXCONTROLS+1];
  39. } DBOX;
  40.  
  41. /* -------- macros for dialog box resource compile -------- */
  42. #define DIALOGBOX(db) DBOX db={ #db,
  43. #define DB_TITLE(ttl,x,y,h,w) {ttl,x,y,h,w},{
  44. #define CONTROL(ty,tx,x,y,h,w,c) \
  45.  {{NULL,x,y,h,w},ty,tx,NULL,c,#c,(ty==BUTTON?ON:OFF),OFF,NULL},
  46.  
  47. #define ENDDB {{NULL}} }};
  48.  
  49. #define Cancel  " Cancel "
  50. #define Ok      "   OK   "
  51. #define Yes     "  Yes   "
  52. #define No      "   No   "
  53.  
  54. #endif
  55.